Optimal. Leaf size=71 \[ \frac {4 \sqrt [4]{-1} a^2 \tanh ^{-1}\left ((-1)^{3/4} \sqrt {\cot (c+d x)}\right )}{d}-\frac {2 a^2}{3 d \cot ^{\frac {3}{2}}(c+d x)}+\frac {4 i a^2}{d \sqrt {\cot (c+d x)}} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.10, antiderivative size = 71, normalized size of antiderivative = 1.00, number of steps
used = 5, number of rules used = 5, integrand size = 26, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.192, Rules used = {3754, 3623,
3610, 3614, 214} \begin {gather*} -\frac {2 a^2}{3 d \cot ^{\frac {3}{2}}(c+d x)}+\frac {4 i a^2}{d \sqrt {\cot (c+d x)}}+\frac {4 \sqrt [4]{-1} a^2 \tanh ^{-1}\left ((-1)^{3/4} \sqrt {\cot (c+d x)}\right )}{d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 214
Rule 3610
Rule 3614
Rule 3623
Rule 3754
Rubi steps
\begin {align*} \int \frac {(a+i a \tan (c+d x))^2}{\sqrt {\cot (c+d x)}} \, dx &=\int \frac {(i a+a \cot (c+d x))^2}{\cot ^{\frac {5}{2}}(c+d x)} \, dx\\ &=-\frac {2 a^2}{3 d \cot ^{\frac {3}{2}}(c+d x)}+\int \frac {2 i a^2+2 a^2 \cot (c+d x)}{\cot ^{\frac {3}{2}}(c+d x)} \, dx\\ &=-\frac {2 a^2}{3 d \cot ^{\frac {3}{2}}(c+d x)}+\frac {4 i a^2}{d \sqrt {\cot (c+d x)}}+\int \frac {2 a^2-2 i a^2 \cot (c+d x)}{\sqrt {\cot (c+d x)}} \, dx\\ &=-\frac {2 a^2}{3 d \cot ^{\frac {3}{2}}(c+d x)}+\frac {4 i a^2}{d \sqrt {\cot (c+d x)}}+\frac {\left (8 a^4\right ) \text {Subst}\left (\int \frac {1}{-2 a^2-2 i a^2 x^2} \, dx,x,\sqrt {\cot (c+d x)}\right )}{d}\\ &=\frac {4 \sqrt [4]{-1} a^2 \tanh ^{-1}\left ((-1)^{3/4} \sqrt {\cot (c+d x)}\right )}{d}-\frac {2 a^2}{3 d \cot ^{\frac {3}{2}}(c+d x)}+\frac {4 i a^2}{d \sqrt {\cot (c+d x)}}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 1.43, size = 90, normalized size = 1.27 \begin {gather*} -\frac {2 a^2 \left (1-6 i \cot (c+d x)+6 \tanh ^{-1}\left (\sqrt {\frac {-1+e^{2 i (c+d x)}}{1+e^{2 i (c+d x)}}}\right ) \cot ^2(c+d x) \sqrt {i \tan (c+d x)}\right )}{3 d \cot ^{\frac {3}{2}}(c+d x)} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [C] Result contains higher order function than in optimal. Order 4 vs. order
3.
time = 26.90, size = 485, normalized size = 6.83
method | result | size |
default | \(\frac {a^{2} \left (\cos \left (d x +c \right )+1\right )^{2} \left (-1+\cos \left (d x +c \right )\right ) \left (6 i \sqrt {-\frac {\cos \left (d x +c \right )-1-\sin \left (d x +c \right )}{\sin \left (d x +c \right )}}\, \sqrt {\frac {\cos \left (d x +c \right )-1+\sin \left (d x +c \right )}{\sin \left (d x +c \right )}}\, \sqrt {\frac {-1+\cos \left (d x +c \right )}{\sin \left (d x +c \right )}}\, \EllipticPi \left (\sqrt {-\frac {\cos \left (d x +c \right )-1-\sin \left (d x +c \right )}{\sin \left (d x +c \right )}}, \frac {1}{2}+\frac {i}{2}, \frac {\sqrt {2}}{2}\right ) \cos \left (d x +c \right ) \sin \left (d x +c \right )-6 i \sqrt {\frac {-1+\cos \left (d x +c \right )}{\sin \left (d x +c \right )}}\, \sqrt {\frac {\cos \left (d x +c \right )-1+\sin \left (d x +c \right )}{\sin \left (d x +c \right )}}\, \sqrt {-\frac {\cos \left (d x +c \right )-1-\sin \left (d x +c \right )}{\sin \left (d x +c \right )}}\, \cos \left (d x +c \right ) \sin \left (d x +c \right ) \EllipticF \left (\sqrt {-\frac {\cos \left (d x +c \right )-1-\sin \left (d x +c \right )}{\sin \left (d x +c \right )}}, \frac {\sqrt {2}}{2}\right )+6 \sqrt {-\frac {\cos \left (d x +c \right )-1-\sin \left (d x +c \right )}{\sin \left (d x +c \right )}}\, \sqrt {\frac {\cos \left (d x +c \right )-1+\sin \left (d x +c \right )}{\sin \left (d x +c \right )}}\, \sqrt {\frac {-1+\cos \left (d x +c \right )}{\sin \left (d x +c \right )}}\, \EllipticPi \left (\sqrt {-\frac {\cos \left (d x +c \right )-1-\sin \left (d x +c \right )}{\sin \left (d x +c \right )}}, \frac {1}{2}+\frac {i}{2}, \frac {\sqrt {2}}{2}\right ) \cos \left (d x +c \right ) \sin \left (d x +c \right )+6 i \sqrt {2}\, \left (\cos ^{2}\left (d x +c \right )\right )-6 i \cos \left (d x +c \right ) \sqrt {2}-\sqrt {2}\, \cos \left (d x +c \right ) \sin \left (d x +c \right )+\sqrt {2}\, \sin \left (d x +c \right )\right ) \sqrt {2}}{3 d \cos \left (d x +c \right ) \sin \left (d x +c \right )^{4} \sqrt {\frac {\cos \left (d x +c \right )}{\sin \left (d x +c \right )}}}\) | \(485\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [B] Both result and optimal contain complex but leaf count of result is larger than
twice the leaf count of optimal. 146 vs. \(2 (57) = 114\).
time = 0.49, size = 146, normalized size = 2.06 \begin {gather*} -\frac {3 \, {\left (-\left (2 i - 2\right ) \, \sqrt {2} \arctan \left (\frac {1}{2} \, \sqrt {2} {\left (\sqrt {2} + \frac {2}{\sqrt {\tan \left (d x + c\right )}}\right )}\right ) - \left (2 i - 2\right ) \, \sqrt {2} \arctan \left (-\frac {1}{2} \, \sqrt {2} {\left (\sqrt {2} - \frac {2}{\sqrt {\tan \left (d x + c\right )}}\right )}\right ) + \left (i + 1\right ) \, \sqrt {2} \log \left (\frac {\sqrt {2}}{\sqrt {\tan \left (d x + c\right )}} + \frac {1}{\tan \left (d x + c\right )} + 1\right ) - \left (i + 1\right ) \, \sqrt {2} \log \left (-\frac {\sqrt {2}}{\sqrt {\tan \left (d x + c\right )}} + \frac {1}{\tan \left (d x + c\right )} + 1\right )\right )} a^{2} + 4 \, {\left (a^{2} - \frac {6 i \, a^{2}}{\tan \left (d x + c\right )}\right )} \tan \left (d x + c\right )^{\frac {3}{2}}}{6 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Both result and optimal contain complex but leaf count of result is larger than twice
the leaf count of optimal. 340 vs. \(2 (57) = 114\).
time = 0.68, size = 340, normalized size = 4.79 \begin {gather*} -\frac {3 \, \sqrt {\frac {16 i \, a^{4}}{d^{2}}} {\left (d e^{\left (4 i \, d x + 4 i \, c\right )} + 2 \, d e^{\left (2 i \, d x + 2 i \, c\right )} + d\right )} \log \left (\frac {{\left (4 i \, a^{2} e^{\left (2 i \, d x + 2 i \, c\right )} + \sqrt {\frac {16 i \, a^{4}}{d^{2}}} {\left (d e^{\left (2 i \, d x + 2 i \, c\right )} - d\right )} \sqrt {\frac {i \, e^{\left (2 i \, d x + 2 i \, c\right )} + i}{e^{\left (2 i \, d x + 2 i \, c\right )} - 1}}\right )} e^{\left (-2 i \, d x - 2 i \, c\right )}}{2 \, a^{2}}\right ) - 3 \, \sqrt {\frac {16 i \, a^{4}}{d^{2}}} {\left (d e^{\left (4 i \, d x + 4 i \, c\right )} + 2 \, d e^{\left (2 i \, d x + 2 i \, c\right )} + d\right )} \log \left (\frac {{\left (4 i \, a^{2} e^{\left (2 i \, d x + 2 i \, c\right )} - \sqrt {\frac {16 i \, a^{4}}{d^{2}}} {\left (d e^{\left (2 i \, d x + 2 i \, c\right )} - d\right )} \sqrt {\frac {i \, e^{\left (2 i \, d x + 2 i \, c\right )} + i}{e^{\left (2 i \, d x + 2 i \, c\right )} - 1}}\right )} e^{\left (-2 i \, d x - 2 i \, c\right )}}{2 \, a^{2}}\right ) - 8 \, {\left (7 \, a^{2} e^{\left (4 i \, d x + 4 i \, c\right )} - 2 \, a^{2} e^{\left (2 i \, d x + 2 i \, c\right )} - 5 \, a^{2}\right )} \sqrt {\frac {i \, e^{\left (2 i \, d x + 2 i \, c\right )} + i}{e^{\left (2 i \, d x + 2 i \, c\right )} - 1}}}{12 \, {\left (d e^{\left (4 i \, d x + 4 i \, c\right )} + 2 \, d e^{\left (2 i \, d x + 2 i \, c\right )} + d\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} - a^{2} \left (\int \frac {\tan ^{2}{\left (c + d x \right )}}{\sqrt {\cot {\left (c + d x \right )}}}\, dx + \int \left (- \frac {2 i \tan {\left (c + d x \right )}}{\sqrt {\cot {\left (c + d x \right )}}}\right )\, dx + \int \left (- \frac {1}{\sqrt {\cot {\left (c + d x \right )}}}\right )\, dx\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [F]
time = 0.00, size = -1, normalized size = -0.01 \begin {gather*} \int \frac {{\left (a+a\,\mathrm {tan}\left (c+d\,x\right )\,1{}\mathrm {i}\right )}^2}{\sqrt {\mathrm {cot}\left (c+d\,x\right )}} \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________